cmake_minimum_required(VERSION 3.10)

# 1. 定义项目名和使用的语言（C++）
project(event_server LANGUAGES CXX)

# 2. 指定 C++ 标准
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

# 3. 查找 pthread（Threads）库
find_package(Threads REQUIRED)

# 4. 添加可执行文件，源文件改为 C++ 后缀
add_executable(event_server
    main.cpp
    configmgr.cpp
    server.cpp
    io_thread.cpp 
    event_loop.cpp
    session.cpp
)

# 5. 链接 pthread（Threads）库
target_link_libraries(event_server
    PRIVATE Threads::Threads
)
